package com.ideafactory.client.br;

import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.SystemProperties;
import android.text.TextUtils;
import android.util.Log;

import com.ideafactory.client.utils.caches.CacheUtils;
import com.ideafactory.client.ybservice.YbSelfService;
import com.ideafactory.client.ybservice.xmpphandler.MachineDetial;

public class BootRestartSeceiver extends BroadcastReceiver {

    private static final String TAG = "BootRestartSeceiver";
    private String ACTION = "android.intent.action.BOOT_COMPLETED";
    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action.equals(ACTION)) {
            Log.e(TAG, "onReceive: " + System.currentTimeMillis());
            try {
                Thread.sleep(10000);
                Intent i = new Intent(context, YbSelfService.class);
                i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                Log.e(TAG, "onReceive: " + System.currentTimeMillis());
                context.startActivity(i);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
